<?php
//处理邀请返利页面 获取传递参数并跳转到首页
include("common.inc.php");
InitGP(array("action","uid","uname","gid")); //初始化变量全局返回
if(!empty($uid)||!empty($uname)){
	$qstring.="action=referrals&";  //构建参数语句
	if(isset($uid))$qstring.="refuid={$uid}&"; 
	if(isset($uname))$qstring.="refuname={$uname}&"; 
	if(isset($gid))$qstring.="gid={$gid}&"; 
	
	if(HTTP_REFERER!=""){
		$qstring.="referer=".HTTP_REFERER.'&';
	}else $qstring.="referer=none";
	
	if(!empty($gid)){
		//有團購ID轉到團購頁面
		dheader("view.php?{$qstring}");//php跳转页面
	}else{
		//跳转到首页
		dheader("index.php?{$qstring}");//php跳转页面
	}
}else {
	//跳转到首页
	dheader("index.php");//php跳转页面
	
}

?>